<template>
    <el-table ref="table"
              :data="data"
              :height="height"
              @selection-change="handleSelection"
              style="width: 100%">
        <el-table-column fixed
                         v-if="$hasPermission('all')"
                         type="selection"
                         width="55">
        </el-table-column>
        <el-table-column v-for="(item , key) in fields"
                         :key="key"
                         :min-width="item.width || 200"
                         :prop="key"
                         :fixed="item.fixed"
                         :label="item.title"/>
    </el-table>
</template>

<script>
    import moment from 'moment';

    export default {
        props: [ 'data', 'height' , 'fields' ],
        data() {
            return {
                multipleSelection: []
            }
        },
        methods: {
            handleSelection(val) {
               this.$emit('selection',val)
            }
        }
    }
</script>

<style scoped>

</style>
